package com.xiaomage.view.animation11

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.widget.ArrayAdapter
import kotlinx.android.synthetic.main.activity_layout_animation_random.*

class LayoutAnimationRandomActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_layout_animation_random)
        val adapter= ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1,
                getData())
        list.adapter=adapter
        bt_add.setOnClickListener{
            adapter.addAll(getData())
        }
    }
    fun getData():ArrayList<String>{
        val data=ArrayList<String>()
        for(i in 0 until 10){
            data.add("测试"+i)
        }
        return data
    }
}
